import { memo } from "react";

const Result = memo((props) => {
    const { keyword } = props;
    if (!keyword) {
        return <div className='alert alert-danger'>请输入搜索关键字</div>;
    }
    const items = new Array(10000).fill(keyword).map((item, index) => {
        return (
            <li className='list-group-item' key={index}>
                {item}-{index}
            </li>
        );
    });
    return (
        <ul
            className='list-group'
            style={{ height: "42px", overflow: "hidden" }}
        >
            {items}
        </ul>
    );
});

export default Result;
